<!DOCTYPE HTML>
<html xmlns:th="http://www.thymeleaf.org">
<head th:replace="common :: head">
</head>
<body>

<div class="container">
    <div th:replace="common :: navbar"></div>

    <div class="row">

        <div class="col-sm-6 ui-widget" id="so">
            <div class="input-group">
                <input id="tags"  type="text" class="form-control" onkeydown="onKeyDown(event)"/>
                <span class="input-group-addon"><a href="javascript:searchInput();"><i
                        class="glyphicon glyphicon-search"> <span>搜索 </span></i></a></span>
            </div>
        </div>

    </div>

    <div class="row">
        <br>
    </div>
    <div class="row col-sm-12 ui-widget">
        <h1>最近更新</h1>
        <!--<ul>-->
            <!--<li th:each="item,itemStat : ${projects}">-->
                <!--<a th:href="'/docs/' + ${item} + '/current'" th:text="${item}"></a>-->
            <!--</li>-->
        <!--</ul>-->

        <div class="row">
            <div class="col-xs-6 col-md-2 " th:each="item,itemStat : ${projects}">
                <a th:href="'/docs/' + ${item} + '/current'" th:text="${item}" class="bg-warning well thumbnail"></a>
            </div>
        </div>
    </div>
</div>
<style>

    a{
        text-decoration:none;
        color:#333;
    }


</style>

<script type="text/javascript">

    function searchInput(){
        var key = $("#tags").val();
        window.location.href="/docs/search/${key}".replace("${key}",key);
    }
    /* 搜索框  */
    function onKeyDown(event) {
        var e = event || window.event || arguments.callee.caller.arguments[0];
        if (e && e.keyCode == 27) { // 按 Esc
            //要做的事情
            alert("你按下了Esc");
        }
        if (e && e.keyCode == 113) { // 按 F2
            //要做的事情
            alert("你按下了F2");
        }
        if (e && e.keyCode == 13) { // enter 键
            searchInput();
            // alert("此处回车触发搜索事件");
        }
    }

    $(function() {
        $( "button" )
            .button()
            .click(function( event ) {
                event.preventDefault();
            });
    });
</script>

<script th:inline="javascript">

</script>

<script>
    var _hmt = _hmt || [];
    (function() {
        var hm = document.createElement("script");
        hm.src = "https://hm.baidu.com/hm.js?4324bd9be7451956396d273de1e9cc75";
        var s = document.getElementsByTagName("script")[0];
        s.parentNode.insertBefore(hm, s);
    })();
</script>

</body>
</html>
